var mysql = require('mysql');

var connection = mysql.createConnection({
    host       : 'localhost',
    user       : 'root',
    password   :'1234',
    database     :'test'
});

connection.connect();

// var addSql = 'INSERT INTO ceshi1(id,name) VALUES(6,"frq")';
var addSql = 'INSERT INTO ceshi1(id,name) VALUES(6,?)';
var addSqlParams = ['frq'];

connection.query(addSql,addSqlParams,function (err,result) {
    if(err){
        console.log('[INSERT ERROR] - ',err.message);
        return;
    }
    console.log('--------------------------INSERT----------------------------');
    //console.log('INSERT ID:',result.insertId);
    console.log('INSERT ID:',result);
    console.log('-----------------------------------------------------------------\n\n');
})
connection.end();
